//通过文件路径获取文件名
export  function formatName (url) {
  let list = url.split("/")
  if(list[list.length-1] == '') return list[list.length-2]
  return list[list.length-1]
}
//获取路径的上级路径
export  function lastPath(path){
  let list = path.split('/')
  let newUrl = ''
  for (let i=0;i<list.length-2;i++){
    newUrl = newUrl+list[i]+'/'
  }
  return newUrl
}

export default {
  formatName,
  lastPath,
};
